var __UIWelcome_instance = null;
function getUIWelcome() { return __UIWelcome_instance; }

var UIWelcome = function(){};


UIWelcome.prototype.onDidLoadFromCCB = function()
{   
    cc.log("UIWelcome.onDidLoadFromCCB");
    __UIWelcome_instance = this;

    // 账号
    var box = cc.EditBox.create(cc.size(207, 29), cc.Scale9Sprite.create("res/misc/none.png"));
    box.setText("test");
    box.setFont("Helvetica", 24);
    box.setAnchorPoint(cc.p(0, 0));
    box.setPosition(cc.p(262, 354));
    box.setFontColor(cc.c3b(120, 250, 70));
    box.setMaxLength(32);
    box.setPlaceholderFontColor(cc.c3b(128, 128, 128));
    box.setPlaceHolder("点击输入账号");
    //box.setInputFlag(cc.EDITBOX_INPUT_FLAG_PASSWORD);
    box.setDelegate(this);
    this.uiWindow.addChild(box);
    this.uiAccount = box;

    // 密码
    var box = cc.EditBox.create(cc.size(207, 29), cc.Scale9Sprite.create("res/misc/none.png"));
    box.setText("test");
    box.setFont("Helvetica", 24);
    box.setAnchorPoint(cc.p(0, 0));
    box.setPosition(cc.p(262, 289));
    box.setFontColor(cc.c3b(120, 250, 70));
    box.setMaxLength(32);
    box.setPlaceholderFontColor(cc.c3b(128, 128, 128));
    box.setPlaceHolder("点击输入密码");
    box.setInputFlag(cc.EDITBOX_INPUT_FLAG_PASSWORD);
    box.setDelegate(this);
    this.uiWindow.addChild(box);
    this.uiPassword = box;

};

UIWelcome.prototype.onStartGame = function()
{	
	cc.log("onStartGame");
    
    //UIManager.changeSceneBattle();
    //UIManager.changeSceneCreateRole();
    var acc = this.uiAccount.getText();
    var pwd = this.uiPassword.getText();
    
    LoginManager.login(acc, pwd);
};